package com.yfbao.horizon.demo;

import cn.hutool.core.io.FileUtil;

import java.io.File;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;

public class LogFileFifter {

    public static void main(String[] args) {
        getFifterFile();
    }


    private static void getFifterFile(){
        String file="C:\\Users\\byf78\\Desktop\\日志分析\\稳定环境\\access_log.2024-02-03.log";
        List<String> list = FileUtil.readLines(new File(file), Charset.defaultCharset());
        ArrayList<String> list1 = new ArrayList<>();
        for (String s : list) {
            if(s.contains("CtpParameterValuesPost")){
                list1.add(s);
            }
        }
        FileUtil.writeLines(list1,new File("C:\\Users\\byf78\\Desktop\\日志分析\\稳定环境\\fifter.txt"),Charset.defaultCharset() );
    }

}
